package recursive;

public class BinomialTest {
    public static void main(String[] args){
        long startTime;
        long entTime;

        int k = 2,n = 10;

        Binomial binomial = new Binomial();
        //递归
        startTime = System.nanoTime();
        System.out.println(binomial.recursion(k,n));
        entTime = System.nanoTime();
        System.out.println("运行时间：" + (entTime - startTime) + "纳秒");

        // 备忘录方法
        startTime = System.nanoTime();
        System.out.println(binomial.memorandum(k,n));
        entTime = System.nanoTime();
        System.out.println("运行时间：" + (entTime - startTime) + "纳秒");

        //迭代算法
        startTime = System.nanoTime();
        System.out.println(binomial.iteration(k,n));
        entTime = System.nanoTime();
        System.out.println("运行时间：" + (entTime - startTime) + "纳秒");
    }
}
